package main

import (
	"log"
	"net"
	"stargazer/xnat/xnetd/server"
	"stargazer/xnat/xnetd/xutil"
)

func main() {
	dbutil := xutil.GetInstance()
	dbutil.Connect()
	tcpServer := &server.TCPServer{}
	tcpServer.ConnChan = make(chan *net.Conn)
	log.Println("start tcp server")
	go tcpServer.RunTCPServer()
	mux := server.GetMuxInstance()

	go mux.AcceptFromTCPServer(tcpServer)
	log.Println("start http server")
	server.RunHTTPServer(mux)
}
